#!/bin/bash

if ! [[ "$PWD" =~ .*\/ucm\/vpkgmgr\/src\/test\/data\/vehiclepackage ]]; then
  echo "This script should be executed in vehiclepackage directory"
  exit
fi
declare -A VPKGS
VPKGS[campaign1,name]="VP_TEST1.zip"
VPKGS[campaign1,dir]="campaign1"
for type in campaign1; do
  # delete previous archive
  rm -v ${VPKGS[$type,name]}
  # recreate archive
  cd ${VPKGS[$type,dir]}
  zip -r ../${VPKGS[$type,name]} \
  vpm.arxml \
  *
  cd ..
done
